/**$Licence:
 *   Use this however/wherever you like, just don't blame me if it breaks anything.
 *   Copyright (C) 2008 - 2012 xingsheng.zhu@gmail.com All rights reserved.
 */
package com.blazemina.exception;

/**
 * @author JackChu
 * @version 1.0.0 2012-1-10 下午5:15:21
 */
public class CreateCommandBeanException extends BlazeminaRuntimeException {
	
	private Class commandClass;
	
	/**
	 * 
	 */
	private static final long serialVersionUID = 2864229356398561797L;

	public CreateCommandBeanException() {
		super();
	}

	public CreateCommandBeanException(String message, Throwable cause) {
		super(message, cause);
	}
	
	/**
	 * Create a new CreateCommandBeanException.
	 * @param beanClass the offending bean class
	 * @param msg the detail message
	 */
	public CreateCommandBeanException(Class beanClass, String msg) {
		this(beanClass, msg, null);
	}

	/**
	 * Create a new CreateCommandBeanException.
	 * @param beanClass the offending bean class
	 * @param msg the detail message
	 * @param cause the root cause
	 */
	public CreateCommandBeanException(Class beanClass, String msg, Throwable cause) {
		super("Could not instantiate bean class [" + beanClass.getName() + "]: " + msg, cause);
		this.commandClass = beanClass;
	}

	/**
	 * Return the offending bean class.
	 */
	public Class getBeanClass() {
		return commandClass;
	}

}
